import Layout from '@/layout'
import RouteButtonsBuilder from '@/framework/infra/router/RouterButtonsBuilder'
import TableButtonType from '@/framework/constant/TableButtonType'

export default [
  {
    path: '/cms',
    component: Layout,
    meta: {title: '内容运营', icon: 'el-icon-document'},
    children: [
      // {
      //   path: 'topic-story',
      //   name: 'cms-topic-story',
      //   component: () => import('@/feature/cms/app/topic-story/index'),
      //   meta: { title: '话题故事', icon: 'table' },
      //   buttons: RouteButtonsBuilder.builder('cms-topic-story').curd()
      //     .build()
      // },
      // {
      //   path: 'trend-comment',
      //   name: 'cms-trend-comment',
      //   component: () => import('@/feature/cms/app/trend-comment/index'),
      //   meta: { title: '社区动态评论', icon: 'el-icon-document' },
      //   buttons: RouteButtonsBuilder.builder('cms-trend-comment').curdoo()
      //     .build()
      // },
      // {
      //   path: 'hot-search',
      //   name: 'cms-hot-search',
      //   component: () => import('@/feature/cms/app/hot-search/index'),
      //   meta: { title: '热门搜索', icon: 'el-icon-document' },
      //   buttons: RouteButtonsBuilder.builder('cms-hot-search').curd()
      //     .build()
      // },
      // {
      //   path: 'wechat-contact',
      //   name: 'cms-wechat-contact',
      //   component: () => import('@/feature/cms/app/wechat-contact/index'),
      //   meta: { title: '微信联系方式', icon: 'el-icon-document' },
      //   buttons: RouteButtonsBuilder.builder('cms-wechat-contact').curdoo()
      //     .build()
      // },
      // {
      //   path: 'article',
      //   name: 'cms-article',
      //   component: () => import('@/feature/cms/app/article/index'),
      //   meta: {title: '常见问题', icon: 'table'},
      //   buttons: RouteButtonsBuilder.builder('cms-article').r()
      //     .build()
      // },
      // {
      //   path: 'article-type',
      //   name: 'cms-article-type',
      //   component: () => import('@/feature/cms/app/info-page/index'),
      //   meta: {title: '页面管理', icon: 'table'},
      //   buttons: RouteButtonsBuilder.builder('cms:info').curdoo()
      //     .build()
      // },
      {
        path: 'banner',
        component: () => import('@/feature/cms/app/banner/index'),
        meta: {title: 'banner管理', icon: 'table'},
        buttons: RouteButtonsBuilder.builder('cms:banner').curdoo()
          .build()
      },
      {
        path: 'activity',
        component: () => import('@/feature/cms/app/activity/index'),
        meta: { title: '活动运营', icon: 'table' },
        buttons: RouteButtonsBuilder.builder('cms:activity').oo()

          .addButtons([
            {
              handler: 'list',
              name: 'list',
              type: TableButtonType.SEARCHBAR,
              label: '搜索',
              icon: 'el-icon-search'
            },
            {
              handler: 'export',
              name: 'export',
              type: TableButtonType.TOOLBAR_RIGHT,
              label: '导出',
              buttonType: 'primary',
              icon: 'el-icon-download'
            },
            {
              handler: 'create',
              name: 'create',
              type: TableButtonType.TOOLBAR,
              label: '新建活动',
              icon: 'el-icon-plus'
            },
            {
              handler: 'update',
              name: 'update',
              type: TableButtonType.ROW,
              label: '修改',
              icon: 'el-icon-edit'
            },
            {
              handler: 'remove',
              name: 'remove',
              type: TableButtonType.ROW,
              label: '删除',
              buttonType: 'danger',
              icon: 'el-icon-delete'
            }
          ])
          .build()
      },
      {
        path: 'article-type',
        component: () => import('@/feature/cms/app/article-type/index'),
        meta: {title: '资讯类型', icon: 'table'},
        buttons: RouteButtonsBuilder.builder('cms:article-type').curdoo()
          .build()
      },
      {
        path: 'article',
        component: () => import('@/feature/cms/app/article/index'),
        meta: {title: '资讯管理', icon: 'table'},
        buttons: RouteButtonsBuilder.builder('cms:article').oo()
          .addButtons([
            {
              handler: 'list',
              name: 'list',
              type: TableButtonType.SEARCHBAR,
              label: '搜索',
              icon: 'el-icon-search'
            },
            {
              handler: 'export',
              name: 'export',
              type: TableButtonType.TOOLBAR_RIGHT,
              label: '导出',
              buttonType: 'primary',
              icon: 'el-icon-download'
            },
            {
              handler: 'create',
              name: 'create',
              type: TableButtonType.TOOLBAR,
              label: '新建文章',
              icon: 'el-icon-plus'
            },
            {
              handler: 'update',
              name: 'update',
              type: TableButtonType.ROW,
              label: '修改',
              icon: 'el-icon-edit'
            },
            {
              handler: 'remove',
              name: 'remove',
              type: TableButtonType.ROW,
              label: '删除',
              buttonType: 'danger',
              icon: 'el-icon-delete'
            }
          ])
          .build()
      },
      {
        path: 'third-party',
        component: () => import('@/feature/cms/app/third-party/index'),
        meta: {title: '第三方平台', icon: 'table'},
        buttons: RouteButtonsBuilder.builder('cms:third-party')

          .addButtons([
            {
              handler: 'list',
              name: 'list',
              type: TableButtonType.SEARCHBAR,
              label: '搜索',
              icon: 'el-icon-search'
            },
            {
              handler: 'export',
              name: 'export',
              type: TableButtonType.TOOLBAR_RIGHT,
              label: '导出',
              buttonType: 'primary',
              icon: 'el-icon-download'
            },
            {
              handler: 'create',
              name: 'create',
              type: TableButtonType.TOOLBAR,
              label: '新建第三方平台',
              icon: 'el-icon-plus'
            },
            {
              handler: 'update',
              name: 'update',
              type: TableButtonType.ROW,
              label: '修改',
              icon: 'el-icon-edit'
            },
            {
              handler: 'remove',
              name: 'remove',
              type: TableButtonType.ROW,
              label: '删除',
              buttonType: 'danger',
              icon: 'el-icon-delete'
            }

          ])
          .build()
      },
      {
        path: 'comment-page',
        component: () => import('@/feature/cms/app/comment-page/index'),
        meta: {title: '评论列表', icon: 'table'},
        buttons: RouteButtonsBuilder.builder('cms:comment-page').addAudit()

          .addButtons([
            {
              handler: 'list',
              name: 'list',
              type: TableButtonType.SEARCHBAR,
              label: '搜索',
              icon: 'el-icon-search'
            },
            // {
            //   handler: 'export',
            //   name: 'export',
            //   type: TableButtonType.TOOLBAR_RIGHT,
            //   label: '导出',
            //   buttonType: 'primary',
            //   icon: 'el-icon-download'
            // },
            // {
            //   handler: 'create',
            //   name: 'create',
            //   type: TableButtonType.TOOLBAR,
            //   label: '新建第三方平台',
            //   icon: 'el-icon-plus'
            // },
            // {
            //   handler: 'audit',
            //   name: 'audit',
            //   type: TableButtonType.ROW,
            //   label: '审核',
            //   icon: 'el-icon-edit'
            // },
            // {
            //   handler: 'remove',
            //   name: 'remove',
            //   type: TableButtonType.ROW,
            //   label: '删除',
            //   buttonType: 'danger',
            //   icon: 'el-icon-delete'
            // }

          ])
          .build()
      }
      // #appendSpot# 生成工具用，不要删了
    ]
  }
]
